<pre class="docs-method-signature"><code>link.label(index)</code></pre>
<p>Return the label at <code>index</code>.</p>

<pre class="docs-method-signature"><code>link.label(index, properties [, opt])</code></pre>
<p>Update <code>properties</code> of the label at <code>index</code>. By default, the new properties are merged into the old ones; pass the <code>{ rewrite: true }</code> option along to disregard old properties.</p>

<p>Example usage:

<pre><code>link.label(0, {
    markup: [
        {
            tagName: 'rect',
            selector: 'body'
        }, {
            tagName: 'text',
            selector: 'label'
        }
    ],
    attrs: {
        body: {
            fill: 'white' // white background
        },
        label: {
            text: 'my label', // text to show
            fill: 'blue' // blue text
        }
    },
    position: {
        distance: 0.5, // midway on the connection path
        offset: {
            x: 10, // 10 local x units to the right
            y: -5 // 5 local y units above
        },
        angle: 45, // rotate by 45 degrees clockwise
        args: {
            keepGradient: true, // auto-rotate by path slope at distance
            ensureLegibility: true // auto-rotate label if upside-down
        }
    }
});</code></pre>

<p>Note that all labels are stored in an array on the link model under the attribute <code>labels</code>. Use the <code>link.labels</code> <a href="#dia.Link.prototype.labels">function</a> to access the array.</p>
